<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>FTensor build and test guide</title>
<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css" />
</head>

<body>
<h1>FTensor build and test guide</h1>

<p>This page is a guide to running the testing and timing programs for the
<a href="http://www.wlandry.net/Projects/FTensor">FTensor</a>
tensor class library as part of GCC integration testing.</p>

<h2>Resource usage</h2>

<p>The uncompressed distribution comprises some 2.9 MB of source files.</p>

<!--
<p>On a Pentium III laptop, the conformance tests take 7 minutes and the
performance tests take 3 minutes.</p>
-->

<h2>Prepare</h2>

<p>To prepare for a build, perform the following:</p>
<ul>
<li>Unpack the source archive.</li>
<li>Change directory to the directory thus created.</li>
<li>Run <code>./waf configure</code> followed by <code>./waf</code>
    to configure and build.</li>
</ul>

<h2>Testing</h2>

<p>FTensor tests in directory <code>tests/conformance</code> exercise
most of the package's possible operations, and the tests in directory
<code>tests/speed</code> compare how fast the FTensor classes are
compared to ordinary arrays.  See the file <code>tests/README</code>
for more information about the two sets of tests.</p>

<p>To build and run the subset of conformance tests meant for compiler
testing, do:</p>

<blockquote><pre><code>
cd tests/conformance
make CXX=&lt;compiler&gt; CXXOPTIMIZE="&lt;flags&gt;" test_compiler
./test_compiler
</code></pre></blockquote>

<p>The conformance tests print out <code>PASS</code> or <code>FAIL</code>
followed by a unique test name.  There should be no failures.</p>

<p>The path to the C++ compiler is defined in <code>CXX</code> and the
compiler optimization options are defined in <code>CXXOPTIMIZE</code>
in the Makefile.  If you don't override them as shown above,
<code>CXX</code> will be <code>g++</code> and <code>CXXOPTIMIZE</code>
will be the flags that are normally used by FTensor developers and
users.  Testing with the usual flags ensures that FTensor will work for
its users on your platform; testing with other optimizations might
uncover GCC bugs.</p>

<p>To build and run the performance tests using the optimizations that
are normally used for them, simply do:</p>

<blockquote><pre><code>
cd tests/speed
make CXX=&lt;compiler&gt; CXXOPTIMIZE="&lt;flags&gt;" one_over one_over_fast
./one_over_script
</code></pre></blockquote>

<p>In addition to printing timing information, <code>one_over_script</code>
prints out <code>PASS</code> or <code>FAIL</code> for each performance test,
followed by the unique test name.  There should be no failures.</p>

<h2>Timing</h2>

<p>The timing information output by the script
<code>tests/speed/one_over_script</code> can be compared for different
versions of GCC, starting with version 3.1.</p>

<h2>Cleanup</h2>

<p>Cleanup (to prepare for a fresh run, e.g.  with another version of
the compiler), is done as follows:</p>

<pre><code>(cd tests/conformance; make clean)
(cd tests/speed; make clean)
</code></pre>

</body>
</html>
